package com.ningxun.pagentcrawler.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * 爬虫配置实体类
 * 用于存储用户配置的爬虫参数
 */
public class CrawlerConfig {
    
    private String id;
    
    /**
     * 配置名称
     */
    private String configName;
    
    /**
     * 网站名称
     */
    private String siteName;
    
    /**
     * 基础URL
     */
    private String baseUrl;
    
    /**
     * 列表页URL模板
     */
    private String listUrlTemplate;
    
    /**
     * 详情页URL模板
     */
    private String detailUrlTemplate;
    
    /**
     * 列表页选择器
     */
    private String listSelector;
    
    /**
     * 标题选择器
     */
    private String titleSelector;
    
    /**
     * 链接选择器
     */
    private String linkSelector;
    
    /**
     * 内容选择器
     */
    private String contentSelector;
    
    /**
     * 文号选择器
     */
    private String documentNumberSelector;
    
    /**
     * 日期选择器
     */
    private String dateSelector;
    
    /**
     * 分页参数名
     */
    private String pageParamName;
    
    /**
     * 最大页数
     */
    private Integer maxPages;
    
    /**
     * 请求间隔(毫秒)
     */
    private Integer requestInterval;
    
    /**
     * 超时时间(毫秒)
     */
    private Integer timeout;
    
    /**
     * User-Agent
     */
    private String userAgent;
    
    /**
     * 是否启用
     */
    private Boolean enabled;
    
    /**
     * 备注
     */
    private String remark;
    
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    
    /**
     * 创建者
     */
    private String createBy;
    
    /**
     * 更新者
     */
    private String updateBy;
    
    // 默认构造函数
    public CrawlerConfig() {}
    
    // Getter和Setter方法
    public String getId() {
        return id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    
    public String getConfigName() {
        return configName;
    }
    
    public void setConfigName(String configName) {
        this.configName = configName;
    }
    
    public String getSiteName() {
        return siteName;
    }
    
    public void setSiteName(String siteName) {
        this.siteName = siteName;
    }
    
    public String getBaseUrl() {
        return baseUrl;
    }
    
    public void setBaseUrl(String baseUrl) {
        this.baseUrl = baseUrl;
    }
    
    public String getListUrlTemplate() {
        return listUrlTemplate;
    }
    
    public void setListUrlTemplate(String listUrlTemplate) {
        this.listUrlTemplate = listUrlTemplate;
    }
    
    public String getDetailUrlTemplate() {
        return detailUrlTemplate;
    }
    
    public void setDetailUrlTemplate(String detailUrlTemplate) {
        this.detailUrlTemplate = detailUrlTemplate;
    }
    
    public String getListSelector() {
        return listSelector;
    }
    
    public void setListSelector(String listSelector) {
        this.listSelector = listSelector;
    }
    
    public String getTitleSelector() {
        return titleSelector;
    }
    
    public void setTitleSelector(String titleSelector) {
        this.titleSelector = titleSelector;
    }
    
    public String getLinkSelector() {
        return linkSelector;
    }
    
    public void setLinkSelector(String linkSelector) {
        this.linkSelector = linkSelector;
    }
    
    public String getContentSelector() {
        return contentSelector;
    }
    
    public void setContentSelector(String contentSelector) {
        this.contentSelector = contentSelector;
    }
    
    public String getDocumentNumberSelector() {
        return documentNumberSelector;
    }
    
    public void setDocumentNumberSelector(String documentNumberSelector) {
        this.documentNumberSelector = documentNumberSelector;
    }
    
    public String getDateSelector() {
        return dateSelector;
    }
    
    public void setDateSelector(String dateSelector) {
        this.dateSelector = dateSelector;
    }
    
    public String getPageParamName() {
        return pageParamName;
    }
    
    public void setPageParamName(String pageParamName) {
        this.pageParamName = pageParamName;
    }
    
    public Integer getMaxPages() {
        return maxPages;
    }
    
    public void setMaxPages(Integer maxPages) {
        this.maxPages = maxPages;
    }
    
    public Integer getRequestInterval() {
        return requestInterval;
    }
    
    public void setRequestInterval(Integer requestInterval) {
        this.requestInterval = requestInterval;
    }
    
    public Integer getTimeout() {
        return timeout;
    }
    
    public void setTimeout(Integer timeout) {
        this.timeout = timeout;
    }
    
    public String getUserAgent() {
        return userAgent;
    }
    
    public void setUserAgent(String userAgent) {
        this.userAgent = userAgent;
    }
    
    public Boolean getEnabled() {
        return enabled;
    }
    
    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }
    
    public String getRemark() {
        return remark;
    }
    
    public void setRemark(String remark) {
        this.remark = remark;
    }
    
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }
    
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
    
    public String getCreateBy() {
        return createBy;
    }
    
    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }
    
    public String getUpdateBy() {
        return updateBy;
    }
    
    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }
    
    @Override
    public String toString() {
        return "CrawlerConfig{" +
                "id='" + id + '\'' +
                ", configName='" + configName + '\'' +
                ", siteName='" + siteName + '\'' +
                ", baseUrl='" + baseUrl + '\'' +
                ", enabled=" + enabled +
                ", maxPages=" + maxPages +
                '}';
    }
} 